package com.dylan.magic.rocketmq.consumer;

import com.dylan.magic.rocketmq.config.mq.BaseMessageConsumer;
import com.dylan.magic.rocketmq.config.mq.MessageTopic;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author : ankang
 * @date : 2020/1/21 21:42
 * @Description :
 */
@Service
@Slf4j
public class MessageTestConsumer extends BaseMessageConsumer {

    /**
     * 消息主题
     *
     * @return 消息主题
     */
    @Override
    protected MessageTopic messageTopic() {
        return MessageTopic.MESSAGE_TEST;
    }

    /**
     * 消息消费实现
     *
     * @param content 消息内容
     * @return 是否消费成功
     */
    @Override
    protected boolean consume(String content) {
        log.info("消费消息，topic:{}，content:{}", messageTopic().getTopic(), content);
        return true;
    }
}
